import request from '@/utils/request'

export function selectMenu(data) {
  return request({
    url: '/menu/selectMenu',
    method: 'get',
    params: data
  })
}

export function insertMenu(data) {
  return request({
    url: '/menu/insertMenu',
    method: 'post',
    params: data
  })
}

export function updateMenu(data) {
  return request({
    url: '/menu/updateMenu',
    method: 'put',
    params: data
  })
}

export function updateChildrenMenu(data) {
  return request({
    url: '/menu/updateChildrenMenu',
    method: 'put',
    params: data
  })
}

export function deleteMenu(data) {
  return request({
    url: '/menu/deleteMenu',
    method: 'delete',
    params: data
  })
}

export function deleteChildrenRole(data) {
  return request({
    url: '/menu/deleteChildrenRole',
    method: 'delete',
    params: data
  })
}

export function validMenuName(data) {
  return request({
    url: '/menu/validMenuName',
    method: 'post',
    params: data
  })
}

export function validMenuPermission(data) {
  return request({
    url: '/menu/validMenuPermission',
    method: 'post',
    params: data
  })
}

export function pickUpRoleMenus(data) {
  return request({
    url: '/menu/pickUpRoleMenus',
    method: 'post',
    params: data
  })
}

export function putDownRoleMenus(data) {
  return request({
    url: '/menu/putDownRoleMenus',
    method: 'delete',
    params: data
  })
}
